<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="t" uri="http://myfaces.apache.org/tomahawk"%>

<%@taglib prefix="a4j" uri="http://richfaces.org/a4j"%>
<%@taglib prefix="rich" uri="http://richfaces.org/rich"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <link type="text/css" rel="stylesheet" href="/finsys/style.css" media="screen"/>
            <title>Transferencia / Recepcion de dinero</title>
        </head>
        <body>
            <h1>Transferencia / Recepcion de dinero</h1>
            <h2>Realizar Operaci&oacute;n</h2>
            <h:form>
                <fieldset>
                    <legend>Detalle de Operaci&oacute;n</legend>
                    <h:panelGrid columns="2">

                        <h:panelGrid columns="1" >
                            <t:dataTable id="tblCajas" value="#{TransRecepController.listado}"
                                         var="item" rowClasses="rowImpar, rowPar">
                                <h:column>
                                    <f:facet name="header"><h:outputText value="Moneda"/></f:facet>
                                    <h:outputText value="#{item.moneda}" />
                                </h:column>
                                <h:column>
                                    <f:facet name="header"><h:outputText value="Saldo"/></f:facet>
                                    <h:outputText value="#{item.saldo}" />
                                </h:column>
                            </t:dataTable>
                        </h:panelGrid>

                        <h:panelGrid columns="1">
                            <a4j:outputPanel ajaxRendered="true">
                                <h:panelGrid columns="2">
                                    <h:outputLabel value="Detalle de la Operacion:" />
                                    <h:panelGroup/>

                                    <h:panelGroup> </h:panelGroup>
                                    <h:panelGroup> </h:panelGroup>

                                    <h:outputLabel value="Elija un tipo de Operacion:" />
                                    <h:selectOneMenu id="cboOperacion" value="#{TransRecepController.tipoOperacion}">
                                        <a4j:support event="onchange" reRender="TipoTransRecep" />
                                        <f:selectItem itemLabel="Transferencia" itemValue="transferencia" />
                                        <f:selectItem itemLabel="Recepcion" itemValue="recepcion" />
                                    </h:selectOneMenu>

                                    <h:outputLabel value="Moneda:" />
                                    <h:selectOneMenu id="cboMoneda" value="dolar">
                                        <f:selectItem itemLabel="($) Dolares" itemValue="dolar" />
                                        <f:selectItem itemLabel="(S/.) Nuevos Soles" itemValue="nuevosol" />
                                        <f:selectItem itemLabel="(€) Euros" itemValue="euros" />
                                    </h:selectOneMenu>
                                </h:panelGrid>

                                <h:panelGroup id="TipoTransRecep">
                                    
                                    <h:panelGrid columns="2" rendered="#{TransRecepController.tipoOperacion == 'transferencia'}">
                                        <h:outputLabel value="Monto a Transferir:" />
                                        <h:inputText id="txtMontoTransferencia" styleClass="inputs"/>

                                        <h:outputLabel value="Destino:" />
                                        <h:selectOneMenu id="cboDestino" value="dolar">
                                            <f:selectItem itemLabel="Boveda" itemValue="boveda" />
                                            <f:selectItem itemLabel="Ventanilla 1" itemValue="ventanilla1" />
                                            <f:selectItem itemLabel="Ventanilla 2" itemValue="ventanilla2" />
                                            <f:selectItem itemLabel="Ventanilla 3" itemValue="ventanilla3" />
                                            <f:selectItem itemLabel="Ventanilla 4" itemValue="ventanilla4" />
                                            <f:selectItem itemLabel="Ventanilla 5" itemValue="ventanilla5" />
                                        </h:selectOneMenu>
                                    </h:panelGrid>

                                    <h:panelGrid columns="2" rendered="#{TransRecepController.tipoOperacion == 'recepcion'}">
                                        <h:outputLabel value="Monto a Recepcionar:" />
                                        <h:inputText id="txtMontoRecepcionar" styleClass="inputs"/>

                                        <h:outputLabel value="Origen:" />
                                        <h:selectOneMenu id="cboOrigen" value="dolar">
                                            <f:selectItem itemLabel="Boveda" itemValue="boveda" />
                                            <f:selectItem itemLabel="Ventanilla 1" itemValue="ventanilla1" />
                                            <f:selectItem itemLabel="Ventanilla 2" itemValue="ventanilla2" />
                                            <f:selectItem itemLabel="Ventanilla 3" itemValue="ventanilla3" />
                                            <f:selectItem itemLabel="Ventanilla 4" itemValue="ventanilla4" />
                                            <f:selectItem itemLabel="Ventanilla 5" itemValue="ventanilla5" />
                                        </h:selectOneMenu>
                                    </h:panelGrid>
                                </h:panelGroup>
                            </a4j:outputPanel>
                            <h:panelGroup>
                                <h:commandButton value="Continuar" action="volver" />
                                <h:commandButton value="Cancelar" action="volver" />
                            </h:panelGroup>
                        </h:panelGrid>
                    </h:panelGrid>
                </fieldset>
            </h:form>
        </body>
    </html>
</f:view>
